package com.wfl.sampling.dao;


import com.wfl.sampling.entity.MessageListDo;
import com.wfl.sampling.entity.User;
import com.wfl.sampling.entity.UserMessageDo;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.List;

/**
 * @ Author     ：gfj
 * @ Date       ：Created in 15:54 2018/12/18
 * @ Description：
 * @ Modified By：
 */
@Mapper
public interface UserDao{
    User findByEmail(String email);

    User findByPhone(String phone);


    int insertUser(User user);

    int updateLastLogin(int id);

    User getUserById(int id);
    User getUserByOpenId(String openId);
    void saveUserInfoById(User user);
    //查询关注者
    ArrayList<User>  selectFollower(Integer id);
    //查询被关注者
    ArrayList<User>  selectFollowered(Integer id);
    void savefollowOnUser(Integer userId,Integer followUser);
    void updateUserConversationTime(Integer userId,Integer otherId,String formattedTime);
    void deletefollowOffUser(Integer userId,Integer followUser);
    void saveConversion(Integer userId, Integer otherId,String formattedTime);
    Integer selectConversion(Integer userId, Integer otherId);
    ArrayList<UserMessageDo>  selectMessage(Integer conversionId);
    void  saveConversionMessage(Integer userId, Integer conversionId,String message);
    ArrayList<MessageListDo> selectMessageUserList(Integer userId);
    ArrayList<MessageListDo> selectMessageGroupList(Integer userId);

    void insertSessionId(String sessionId, String res);
//    void selectSessionId(String sessionId);
    String selectSessionById(String sessionId);
}
